<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: wickr_kdf</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">wickr_kdf</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Metadata associated with a particular KDF function.  <a href="structwickr__kdf__algo.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents the information the KDF function will need along with it's input to derive a particular output.  <a href="structwickr__kdf__meta.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents the result of a KDF function execution.  <a href="structwickr__kdf__result.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga5e8df13eb2cd5cc1e09f377675ddc50f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga5e8df13eb2cd5cc1e09f377675ddc50f">SCRYPT_2_17_COST</a>&#160;&#160;&#160;1116161</td></tr>
<tr class="separator:ga5e8df13eb2cd5cc1e09f377675ddc50f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga106149e3507106abb6b5be843a4e7c16"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga106149e3507106abb6b5be843a4e7c16">wickr_kdf_algo_id</a> { <b>KDF_BCRYPT</b>, 
<b>KDF_SCRYPT</b>, 
<b>KDF_HMAC_SHA2</b>
 }</td></tr>
<tr class="separator:ga106149e3507106abb6b5be843a4e7c16"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaeee99bcfbf94fd964158ac402e2deb48"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#gaeee99bcfbf94fd964158ac402e2deb48">wickr_kdf_meta_create</a> (<a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *salt, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *info)</td></tr>
<tr class="separator:gaeee99bcfbf94fd964158ac402e2deb48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga92020ae3e8ffb469c927d17f95a7dff1"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga92020ae3e8ffb469c927d17f95a7dff1">wickr_kdf_meta_size_with_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:ga92020ae3e8ffb469c927d17f95a7dff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1bc501706b4a8a727dfd34f8a00e56da"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga1bc501706b4a8a727dfd34f8a00e56da">wickr_kdf_meta_serialize</a> (const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *meta)</td></tr>
<tr class="separator:ga1bc501706b4a8a727dfd34f8a00e56da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaebd1caf94717c403c4afb5cca8f511b6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#gaebd1caf94717c403c4afb5cca8f511b6">wickr_kdf_meta_create_with_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:gaebd1caf94717c403c4afb5cca8f511b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6ed878108fd58ee420239689de505190"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga6ed878108fd58ee420239689de505190">wickr_kdf_meta_copy</a> (const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *source)</td></tr>
<tr class="separator:ga6ed878108fd58ee420239689de505190"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2bd458ae83d4d5bb03b9d0835baeefd7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga2bd458ae83d4d5bb03b9d0835baeefd7">wickr_kdf_meta_destroy</a> (<a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> **meta)</td></tr>
<tr class="separator:ga2bd458ae83d4d5bb03b9d0835baeefd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga514c095b3b2f1ead49bd7fbf0b427407"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga514c095b3b2f1ead49bd7fbf0b427407">wickr_kdf_result_create</a> (<a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *meta, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *hash)</td></tr>
<tr class="separator:ga514c095b3b2f1ead49bd7fbf0b427407"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga69c03c94bf446471ba74f76ee883f8d4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga69c03c94bf446471ba74f76ee883f8d4">wickr_kdf_result_copy</a> (const <a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *source)</td></tr>
<tr class="separator:ga69c03c94bf446471ba74f76ee883f8d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61ff0036a7257321ff0bbdc184d856a3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga61ff0036a7257321ff0bbdc184d856a3">wickr_kdf_result_destroy</a> (<a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> **result)</td></tr>
<tr class="separator:ga61ff0036a7257321ff0bbdc184d856a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc745cc1349f64c0f25d6d12de5f64cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#gabc745cc1349f64c0f25d6d12de5f64cd">wickr_perform_kdf</a> (<a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td></tr>
<tr class="separator:gabc745cc1349f64c0f25d6d12de5f64cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga69674856e11652a18663fc7f833ad974"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga69674856e11652a18663fc7f833ad974">wickr_perform_kdf_meta</a> (const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *existing_meta, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td></tr>
<tr class="separator:ga69674856e11652a18663fc7f833ad974"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga81c7a5adea69d04e019dd58080268a08"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__kdf.html#ga81c7a5adea69d04e019dd58080268a08">wickr_hkdf_algo_for_digest</a> (<a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest)</td></tr>
<tr class="separator:ga81c7a5adea69d04e019dd58080268a08"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga5e8df13eb2cd5cc1e09f377675ddc50f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e8df13eb2cd5cc1e09f377675ddc50f">&#9670;&nbsp;</a></span>SCRYPT_2_17_COST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SCRYPT_2_17_COST&#160;&#160;&#160;1116161</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Scrypt Cost</p>
<p>In order to conform to MCF format, scrypt provides a method of compressing its parameters into a single uint32 value. This calculation is leveraged here for the simplicity of having a single value represent N, r, and p values </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga106149e3507106abb6b5be843a4e7c16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga106149e3507106abb6b5be843a4e7c16">&#9670;&nbsp;</a></span>wickr_kdf_algo_id</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__wickr__kdf.html#ga106149e3507106abb6b5be843a4e7c16">wickr_kdf_algo_id</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>KDF Algorithm ID</p>
<p>Define the base algorithm a particular kdf function uses. Scrypt, Bcrypt, and HKDF are currently supported. The preferred default is to use scrypt, with a minimum of n = 2^17 </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga81c7a5adea69d04e019dd58080268a08"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga81c7a5adea69d04e019dd58080268a08">&#9670;&nbsp;</a></span>wickr_hkdf_algo_for_digest()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a>* wickr_hkdf_algo_for_digest </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__digest.html">wickr_digest_t</a>&#160;</td>
          <td class="paramname"><em>digest</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find the HKDF <a class="el" href="structwickr__kdf__algo.html" title="Metadata associated with a particular KDF function.">wickr_kdf_algo</a> that matches a specific digest</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">digest</td><td>the digest to search for </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>HKDF <a class="el" href="structwickr__kdf__algo.html" title="Metadata associated with a particular KDF function.">wickr_kdf_algo</a> that uses 'digest' </dd></dl>

</div>
</div>
<a id="ga6ed878108fd58ee420239689de505190"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6ed878108fd58ee420239689de505190">&#9670;&nbsp;</a></span>wickr_kdf_meta_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a>* wickr_kdf_meta_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a KDF Metadata set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the metadata set to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated metadata set holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="gaeee99bcfbf94fd964158ac402e2deb48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeee99bcfbf94fd964158ac402e2deb48">&#9670;&nbsp;</a></span>wickr_kdf_meta_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a>* wickr_kdf_meta_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a>&#160;</td>
          <td class="paramname"><em>algo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>salt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a KDF Metadata set from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">algo</td><td>see '<a class="el" href="structwickr__kdf__meta.html" title="Represents the information the KDF function will need along with it&#39;s input to derive a particular ou...">wickr_kdf_meta</a>' property documentation </td></tr>
    <tr><td class="paramname">salt</td><td>see '<a class="el" href="structwickr__kdf__meta.html" title="Represents the information the KDF function will need along with it&#39;s input to derive a particular ou...">wickr_kdf_meta</a>' property documentation </td></tr>
    <tr><td class="paramname">info</td><td>see '<a class="el" href="structwickr__kdf__meta.html" title="Represents the information the KDF function will need along with it&#39;s input to derive a particular ou...">wickr_kdf_meta</a>' property documentation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated KDF Metadata set, owning the properties that were passed in </dd></dl>

</div>
</div>
<a id="gaebd1caf94717c403c4afb5cca8f511b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaebd1caf94717c403c4afb5cca8f511b6">&#9670;&nbsp;</a></span>wickr_kdf_meta_create_with_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a>* wickr_kdf_meta_create_with_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a KDF Metadata set from a buffer created by 'wickr_kdf_meta_serialize'</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>a buffer containing a bytes created by 'wickr_kdf_meta_serialize' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated KDF Metadata set. NULL if parsing fails because buffer does not contain valid bytes </dd></dl>

</div>
</div>
<a id="ga2bd458ae83d4d5bb03b9d0835baeefd7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2bd458ae83d4d5bb03b9d0835baeefd7">&#9670;&nbsp;</a></span>wickr_kdf_meta_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_kdf_meta_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> **&#160;</td>
          <td class="paramname"><em>meta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a KDF Metadata set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">meta</td><td>a pointer to the metadata set to destroy. All properties of '*meta' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1bc501706b4a8a727dfd34f8a00e56da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1bc501706b4a8a727dfd34f8a00e56da">&#9670;&nbsp;</a></span>wickr_kdf_meta_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_kdf_meta_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td>
          <td class="paramname"><em>meta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize a KDF Metadata set</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">meta</td><td>metadata set to serialize to a buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing serialized bytes from 'meta' in the following format: | ALGO_ID | SALT | </dd></dl>

</div>
</div>
<a id="ga92020ae3e8ffb469c927d17f95a7dff1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga92020ae3e8ffb469c927d17f95a7dff1">&#9670;&nbsp;</a></span>wickr_kdf_meta_size_with_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t wickr_kdf_meta_size_with_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Determine the size of serialized metadata given a serialized KDF Metadata buffer</p>
<p>This function is useful for determining the number of bytes within a larger buffer are part of the KDF metadata</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>a buffer beginning with bytes generated from 'wickr_kdf_meta_serialize' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes consumed by a piece of serialized metadata at the beginning of buffer 'buffer'. 0 if the buffer does not start with a valid piece of serialized metadata </dd></dl>

</div>
</div>
<a id="ga69c03c94bf446471ba74f76ee883f8d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga69c03c94bf446471ba74f76ee883f8d4">&#9670;&nbsp;</a></span>wickr_kdf_result_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>* wickr_kdf_result_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a KDF result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the metadata set to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated kdf result holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="ga514c095b3b2f1ead49bd7fbf0b427407"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga514c095b3b2f1ead49bd7fbf0b427407">&#9670;&nbsp;</a></span>wickr_kdf_result_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>* wickr_kdf_result_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td>
          <td class="paramname"><em>meta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>hash</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a KDF Result from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">meta</td><td>see '<a class="el" href="structwickr__kdf__result.html" title="Represents the result of a KDF function execution.">wickr_kdf_result</a>' property documentation </td></tr>
    <tr><td class="paramname">hash</td><td>see '<a class="el" href="structwickr__kdf__result.html" title="Represents the result of a KDF function execution.">wickr_kdf_result</a>' property documentation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated KDF result, owning the properties that were passed in </dd></dl>

</div>
</div>
<a id="ga61ff0036a7257321ff0bbdc184d856a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga61ff0036a7257321ff0bbdc184d856a3">&#9670;&nbsp;</a></span>wickr_kdf_result_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_kdf_result_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> **&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a KDF result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>a pointer to the result to destroy. All properties of '*result' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gabc745cc1349f64c0f25d6d12de5f64cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabc745cc1349f64c0f25d6d12de5f64cd">&#9670;&nbsp;</a></span>wickr_perform_kdf()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>* wickr_perform_kdf </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a>&#160;</td>
          <td class="paramname"><em>algo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>passphrase</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Execute a KDF function given an input buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">algo</td><td>the algorithm info to use for execution of the KDF </td></tr>
    <tr><td class="paramname">passphrase</td><td>bytes to use as input to the KDF function. There are no restrictions for the content of the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the output of the KDF function, including the generated random salt that was used for the computation </dd></dl>

</div>
</div>
<a id="ga69674856e11652a18663fc7f833ad974"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga69674856e11652a18663fc7f833ad974">&#9670;&nbsp;</a></span>wickr_perform_kdf_meta()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>* wickr_perform_kdf_meta </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *&#160;</td>
          <td class="paramname"><em>existing_meta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>passphrase</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Execute a KDF function given an input buffer and specified parameters</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">existing_meta</td><td>the parameters to use for execution, including a specific salt </td></tr>
    <tr><td class="paramname">passphrase</td><td>bytes to use as input to the KDF function. There are no restrictions for the content of the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the output of the KDF function, including the generated random salt that was used for the computation </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
